package menu;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.beans.PropertyVetoException;
import java.io.IOException;
import java.sql.SQLException;
import java.text.ParseException;

import main.Application;

import org.xml.sax.SAXException;

import exception.ModifyRigntsLevelException;
import exception.PDFVewerException;
import exception.XRADFTPException;
import exception.queryBuilder.AliasNotFound;
import exception.queryBuilder.AttribNotFound;
import exception.queryBuilder.UndefineKeyType;
import exception.recordEdit.RecordEditNotFoundException;
import exception.recordEdit.SuchComponentExictException;

public abstract class ExceptionCatcher implements ActionListener 
{
	protected ActionEvent eventArgs;
	@Override
	public void actionPerformed(ActionEvent arg0) 
	{
		eventArgs=arg0;
		Thread thread = new Thread()
		{
			public void run()
			{
				
				try {
					runMenuAction();
				} 				
				catch (Exception e) 
				{
					Application.getInstance().notifyAboutException(e);					
				}					
			}
		};
		thread.start();

	}
	protected abstract void runMenuAction() throws AttribNotFound, UndefineKeyType, SQLException, ModifyRigntsLevelException, AliasNotFound, PropertyVetoException, RecordEditNotFoundException, SuchComponentExictException, SAXException, IOException, ParseException, ClassNotFoundException, InstantiationException, IllegalAccessException, XRADFTPException, IllegalStateException, PDFVewerException;
}
